from django.urls import path
from . import views

app_name = 'tasks'

urlpatterns = [
    # 定时任务管理
    path('scheduled_tasks/', views.scheduled_task_list, name='scheduled_task_list'),
    path('scheduled_tasks/create/', views.scheduled_task_create, name='scheduled_task_create'),
    path('scheduled_tasks/edit/<int:task_id>/', views.scheduled_task_edit, name='scheduled_task_edit'),
    path('scheduled_tasks/delete/<int:task_id>/', views.scheduled_task_delete, name='scheduled_task_delete'),
    
    # 任务执行日志
    path('task_execution_logs/', views.task_execution_logs, name='task_execution_logs'),
    path('task_execution_logs/detail/<int:log_id>/', views.task_execution_log_detail, name='task_execution_log_detail'),
    path('task_execution_logs/delete/<int:log_id>/', views.task_execution_log_delete, name='task_execution_log_delete'),
    path('task_execution_logs/bulk_delete/', views.task_execution_logs_bulk_delete, name='task_execution_logs_bulk_delete'),
    
    # 立即执行任务
    path('scheduled_tasks/execute_now/<int:task_id>/', views.task_execute_now, name='task_execute_now'),
    # 切换任务状态
    path('scheduled_tasks/toggle_status/<int:task_id>/', views.scheduled_task_toggle_status, name='scheduled_task_toggle_status'),
    # 重启任务管理器
    path('scheduled_tasks/restart_scheduler/', views.restart_task_scheduler, name='restart_task_scheduler'),
    # 重启所有服务
    path('scheduled_tasks/restart_all_services/', views.restart_all_services, name='restart_all_services'),
]